package com.ruoyi.mobile.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.mobile.domain.ShProductEntity;
import com.ruoyi.system.api.resp.DictResp;
import com.ruoyi.system.api.resp.ShProductResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 商品信息Mapper接口
 */
@Mapper
@DS("master")
public interface IShProductMapper extends BaseMapper<ShProductEntity> {
    @Select("select dict_value AS dictValue,dict_label AS dictLabel from sys_dict_data where dict_type=#{dictType} and dict_value<=80 order by dict_sort asc")
    public List<DictResp> selectDictByType(@Param("dictType")String dictType);

    @Select("select dict_value AS dictValue,dict_label AS dictLabel from sys_dict_data where dict_type=#{dictType} and dict_value>90 order by dict_sort asc")
    public List<DictResp> selectMealByType(@Param("dictType")String dictType);

    @Select("select dict_value AS dictValue,dict_label AS dictLabel from sys_dict_data where dict_type=#{dictType} and dict_value>80 and dict_value<=90 order by dict_sort asc")
    public List<DictResp> selectTrainByType(@Param("dictType")String dictType);
}